home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_root.amitavaplay == true)
- {
- if(_root.level == 4)
- {
- if(st == 1)
- {
- att = true;
- st = 0;
- }
- }
- if(_root.amitavaplay == false)
- {
- att = false;
- }
- if(att == true)
- {
- dx = _X - _root.tank._x;
- dy = _Y - _root.tank._y;
- d = Math.sqrt(dx * dx + dy * dy);
- if(100 < d)
- {
- rad = Math.atan2(dy,dx) + 3.141592653589793;
- deg = rad * 180 / 3.141592653589793;
- _rotation = deg;
- b = speed * Math.cos(rad);
- p = speed * Math.sin(rad);
- _X = _X + b;
- _Y = _Y + p;
- treadcheckb++;
- if(5 < treadcheckb)
- {
- treadcountb++;
- duplicateMovieClip(_root.treadb,"treadb" + treadcountb,16384 + (treadcountb % 800 + 8000));
- treadcheckb = 0;
- }
- }
- else if(0 < _root.amithealth)
- {
- this.gotoAndStop(2);
- }
- else
- {
- this.gotoAndStop(1);
- }
- }
- }
- else
- {
- this.gotoAndStop(1);
- }
- }
-